﻿using System;
using System.Drawing;
using ContractManagementSystem.BusinessLogic;
using ContractManagementSystem.Entity;

namespace ContractManagementSystem
{
    public partial class AddContractType : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void AddButtonClick(object sender, EventArgs e)
        {
            var entity = new ContractTypeEntity { Name = NameTextBox.Text, Description = DescriptionTextBox.Text };
            if (ContractTypeBusiness.Insert(entity))
            {
                MessLabel.ForeColor = Color.Teal;
                MessLabel.Text = "Success !";
                NameTextBox.Text = String.Empty;
            }
            else
            {
                MessLabel.ForeColor = Color.Red;
                MessLabel.Text = "Failure !";
            }
        }
    }
}
